package com.gamebase.net.rpc
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.utils.Dictionary;
	
	public class Manager extends EventDispatcher
	{
		protected var callbackList:Dictionary = new Dictionary();
		protected var session:Session = Session.instance;
		public function Manager(target:IEventDispatcher=null)
		{			
			super(target);
		}
		protected function fireEvent(type:String,data:Object):void
		{
			var cb:Function =  callbackList[type] as Function;
			if(cb!=null)
				cb.call(null,data);
			else
				Debug.append("manager:,S->C,",type,",without handler.");
		}
		
		public function addListener(type:String,callback:Function):void
		{
			callbackList[type] = callback;
		}
	}
}